//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_removenvgoggles.sqf"
#include "x_setup.sqf"

if (GVAR(without_nvg) != 0) exitWith {};

private "_assigneditems";
_assigneditems = assigneditems _this;
// TYRGHEN
// if ("NVGoggles" in _assigneditems) then {
	// _this unlinkItem "NVGoggles";
// } else {
	// if ("NVGoggles_OPFOR" in _assigneditems) then {
		// _this unlinkItem "NVGoggles_OPFOR";
	// } else {
		// if ("NVGoggles_INDEP" in _assigneditems) then {
			// _this unlinkItem "NVGoggles_INDEP";
		// };
	// };
// };
{  
	if (isClass(configFile/"CfgWeapons"/_x) && { (getText(configFile/"CfgWeapons"/_x/"simulation")) == "NVGoggles" }) exitWith { _this unlinkItem _x };
} foreach _assigneditems;